package data

import (
	"fmt"
	"stormragetech/dawn/conf"

	"github.com/go-redis/redis"
)

// Client Redis连接统一入口
var Client *redis.Client

func init() {
	c := redis.NewClient(&redis.Options{
		Addr:     conf.Conf.RedisAddr,
		Password: conf.Conf.RedisPwd,
		DB:       conf.Conf.RedisDb,
		PoolSize: conf.Conf.RedisPool,
	})
	// defer c.Close()

	pong, err := c.Ping().Result()
	fmt.Println(pong, err)
	Client = c
}
